import java.util.Scanner;
import java.io.*;
public class MiddlePoint {
	public static void main(String[] args) throws IOException
	{
     int leftsum = 0;
     int totalsum = 0;
     int ga =0;
	 Scanner scan = new Scanner(System.in);	
	 System.out.print("Enter the size of the array :");
	 int size = scan.nextInt();
	 int[] series = new int[size];
	 System.out.print("Enter the  array:");
	 for(int i=0;i<size;i++){
		 String token = scan.next();
         series[i] = Integer.parseInt(token);
         
         }
	 
         System.out.print("The entered Array is : ");
         for(int i=0;i<size;i++){
         System.out.print(series[i]+" ");
         totalsum = totalsum+series[i];
         for(int j=0;j<i-1;j++){
        	 leftsum = leftsum+series[j];
         }
       int rightsum = totalsum-(series[i]+leftsum);
       if (leftsum == rightsum)
       {
    	    ga = series[i];
       }
      // else 
    	//   System.out.println("No midpoint");
    	   
	 }
         System.out.print("\n"+totalsum +"\n");
   //    System.out.print("The midpoint is :" +ga);
      // System.out.print("\n" +"The left handed sum of the series :" + leftsum);
	}
}
